package com.tencent;

import java.io.File;
import java.util.Hashtable;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.tencent.protocol.pay_query_protocol.ScanPayQueryReqData;
import com.tencent.protocol.unifiedorder_protocol.UnifiedorderReqData;

public class Test {

	public static void main(String[] args) {
		try {
			UnifiedorderReqData unifiedorderReqData = new UnifiedorderReqData("IPad", "20150806125346", 1999, "61.171.124.204", "http://www.weixin.qq.com/wxpay/pay.php", "NATIVE");
			String result = WXPay.requestUnifiedorderService(unifiedorderReqData);
			
			System.out.println(result);
			
			/*String text = "weixin://wxpay/bizpayurl?pr=zc1qGRi";
			int width = 300;
			int height = 300;
			String format = "png";
			Hashtable hints = new Hashtable();
			hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
			BitMatrix bitMatrix = new MultiFormatWriter().encode(result, BarcodeFormat.QR_CODE, width, height, hints);
			File outputFile = new File("d:\\new.png");
			MatrixToImageWriter.writeToFile(bitMatrix, format, outputFile);*/
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
